import { message } from 'ant-design-vue'
import http from '@/config/axios-config'

export const loadList = (url, params = {}) => {
  return new Promise(resolve => {
    http.get(url, params).then(res => {
      if (res.code === 200) {
        resolve(res.result)
      } else {
        resolve({ list: [], count: 0 })
      }
    }).catch(() => {
      message.error('list load error')
    })
  })
}
